<!DOCTYPE html>
<html>
<head>

<link rel="stylesheet" type="text/css" href="https://www.ebi.ac.uk/~mnuhn/regulatory_build_stats/js/datatables.css"/>

<script src="https://www.ebi.ac.uk/~mnuhn/regulatory_build_stats/js/Chart.bundle.js"></script>
<script src="https://www.ebi.ac.uk/~mnuhn/regulatory_build_stats/js/utils.js"></script>

<script type="text/javascript" language="javascript" src="https://www.ebi.ac.uk/~mnuhn/regulatory_build_stats/js/jquery-1.12.4.js"></script>

<script type="text/javascript" src="https://www.ebi.ac.uk/~mnuhn/regulatory_build_stats/js/datatables.js"></script>

</head>
<body>

<h1>Read files</h1>

<h2>Source</h2>

<p>
    This report is based 
</p>

<ul>
  <li>
    on the database <em>[% dbc.dbname %]</em> 
  </li>
  <li>
    on <em>[% dbc.host   %]:[% dbc.port   %]</em> 
  <li>
    on <em>[% time %]</em>.
  </li>
</ul>

<script type="text/javascript" class="init">

$(document).ready(function() {
    $('#read_file_1').DataTable(
        {
            "iDisplayLength": 10,
        }
    );
} );

$(document).ready(function() {
    $('#read_file_3').DataTable(
        {
            "iDisplayLength": 10,
        }
    );
} );

$(document).ready(function() {
    $('#read_file_4').DataTable(
        {
            "iDisplayLength": 10,
        }
    );
} );

</script>

<h2>Types of sequencing protocols</h2>

<p>
  For every type of Protocol this shows the number of experiments using that protocol.
<p>

<table id="read_file_1" class="display" cellspacing="0" width="100%">
<thead>
    <tr>
        <th>Protocol</th>
        <th>Number of experiments</th>
    </tr>
</thead>
<tbody>

[% FOR read_file_analysis_experiment_count IN read_file_analysis_experiment_counts.values %]
<tr>
    <td>[% read_file_analysis_experiment_count.logic_name %]</td>
    <td align="right">[% read_file_analysis_experiment_count.count_experiments %]</td>
</tr>
[% END %]

</tbody>
</table>

<h2>Statistics</h2>

<p>
  The high throughput experiments have a total of
</p>

<ul>
  <li>[% format_number( total_number_of_reads ) %] reads and occupy</li>
  <li>[% format_number( bytes_to_gb ( total_file_size ) ) %] GB of disk space.</li>
</ul>

<h3>Signal Experiments</h3>

<table id="read_file_3" class="display" cellspacing="0" width="100%">
<thead>
    <tr>
        <th>Experiment</th>
        <th>Feature type</th>
        <th>Read type</th>
        <th>Replicate configurations</th>
        <th>Number of reads</th>
        <th>Sum of read file sizes in GB</th>
        <th>Ratio of read counts: signal/control</th>
    </tr>
</thead>
<tbody>

[% FOR experiment IN signal_experiments %]

<tr>
    <td>[% experiment.name %]</td>
    <td align="right">[% experiment.feature_type.name       %]</td>
    <td>[% experiment.summarise_read_types %]</td>
    <td>[% experiment.summarise_replicate_configurations %]</td>
    <td align="right">[% format_number( experiment.sum_number_of_reads )   %]</td>
    <td align="right">[% format_number( bytes_to_gb ( experiment.sum_read_file_sizes ) )   %]</td>
    <td align="right">[% round_num( experiment.signal_to_control_read_file_ratio ) %]</td>
</tr>
[% END %]

</tbody>
</table>

<h3>Control Experiments</h3>

<table id="read_file_4" class="display" cellspacing="0" width="100%">
<thead>
    <tr>
        <th>Experiment</th>
        <th>Feature type</th>
        <th>Read type</th>
        <th>Replicate configurations</th>
        <th>Number of reads</th>
        <th>Sum of read file sizes in GB</th>
    </tr>
</thead>
<tbody>

[% FOR experiment IN control_experiments %]
<tr>
    <td>[% experiment.name %]</td>
    <td>[% experiment.feature_type.name       %]</td>
    <td>[% experiment.summarise_read_types %]</td>
    <td>[% experiment.summarise_replicate_configurations %]</td>
    <td align="right">[% format_number( experiment.sum_number_of_reads )   %]</td>
    <td align="right">[% format_number( bytes_to_gb ( experiment.sum_read_file_sizes ) )   %]</td>
</tr>
[% END %]

</tbody>
</table>

</body>
</html>
